import os.path

import pandas as pd
import numpy as np

if __name__ == '__main__':
    dataset_l = [
                 'amazon-home-kitchen.csv', 'yahoomusic.csv']
    # dataset_l = ['amazon.csv', 'book-crossing.csv', 'goodreads.csv', 'movielens-27m.csv', 'netflix.csv',
    #              'yahoomusic.csv', 'yahoomusic_big.csv']
    basic_dir = '/home/bianzheng/CLionProjects/rec2-mips/intermediate-rating-csv'
    for ds in dataset_l:
        df = pd.read_csv(os.path.join(basic_dir, ds))
        userID_l = df['userID']
        itemID_l = df['itemID']
        n_user = max(userID_l)
        n_item = max(itemID_l)
        n_rate_user = len(np.unique(userID_l))
        n_rate_item = len(np.unique(itemID_l))
        print("dataset {}, n_user {}, n_item {}, n_rate_user {}, n_rate_item {}".format(
            ds, n_user, n_item, n_rate_user, n_rate_item))
